﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SharpFaceRecognition
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();

        }

        private void MainForm_Load(object sender, EventArgs e)
        {
            Emgu.CV.VideoCapture Capture = new Emgu.CV.VideoCapture();
            Capture.ImageGrabbed += new EventHandler(imageGrabbed);
            Capture.Start();
            this.Width =  Capture.Width;
            this.Height =  Capture.Height;
        }
         private void imageGrabbed(object sender, EventArgs e)
        {
            Emgu.CV.VideoCapture Capture = sender as  Emgu.CV.VideoCapture;
            Emgu.CV.Mat img = new Emgu.CV.Mat();
            Capture.Read(img);
            this.imageBox.Image = img;
        }

        private void imageBox_Click(object sender, EventArgs e)
        {
           
        }

       
    }
}
